package com.doxiaopu.students.service;

import com.doxiaopu.students.user.entity.User;
import com.doxiaopu.students.user.service.IUserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;

@SpringBootTest
public class UserServiceTestCase {
    @Autowired(required = false)
    private IUserService userService;

    @Test
    public void addNewUser() {
        Date now = new Date();
        User user = new User();
        user.setUsername("root5");
        user.setPassword("1234");
        user.setGender(1);
//        user.setId(18);
        user.setPhone("13883258584");
        user.setNickname("小王");
        user.setSalt("Hello,MD5!");
        user.setIsDelete(0);
//        user.setAvatar("男");
        user.setCreatedUser("Admin");
        user.setModifiedUser("Admin");
        user.setCreatedTime(now);
        user.setModifiedTime(now);
        System.err.println("user:" + user);
//        System.err.println("userMapper:" + userService.reg(user));
        User result = userService.reg(user);
        System.err.println("result:" + result);
    }
}
